package com.epam.necklace.view.menu.mainmenu.submenu;

import java.util.ArrayList;
import java.util.List;

import org.apache.log4j.Logger;

import com.epam.necklace.view.menu.Menu;
import com.epam.necklace.view.menu.MenuItem;
import com.epam.necklace.view.menu.mainmenu.CompositionNecklace;
import com.epam.necklace.view.menu.mainmenu.CreateNecklace;
import com.epam.necklace.view.menu.mainmenu.Exit;
import com.epam.necklace.view.menu.mainmenu.FileRead;
import com.epam.necklace.view.menu.mainmenu.FileWrite;
import com.epam.necklace.view.menu.mainmenu.PriseNecklace;
import com.epam.necklace.view.menu.mainmenu.TransparencySearch;
import com.epam.necklace.view.menu.mainmenu.SortingNecklace;
import com.epam.necklace.view.menu.mainmenu.WeightNecklace;

public class MainMenu extends MenuItem {
	public static final List<MenuItem> items;
	private static final Logger log = Logger.getLogger(MainMenu.class);
	private final Menu subMenu;
	static {
		items = new ArrayList<MenuItem>();
		items.add(new CreateNecklace());
		items.add(new CompositionNecklace());
		items.add(new WeightNecklace());
		items.add(new PriseNecklace());
		items.add(new SortingNecklace());
		items.add(new TransparencySearch());
		items.add(new FileWrite());
		items.add(new FileRead());
		items.add(new Exit());
	}

	public MainMenu() {
		super("Main menu", "0");
		subMenu = new Menu(items);
	}

	@Override
	public boolean execute() {
		log.info("Main menu comand");
		subMenu.run();
		return true;
	}

}
